package service.Impl;


import com.alibaba.fastjson.JSON;
import mapper.CourseMapper;
import mapper.Impl.CourseMapperImpl;
import pojo.Course;
import service.CourseService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;


public class CourseServiceImpl implements CourseService {

    private CourseMapper courseMapper = new CourseMapperImpl();
    @Override
    public boolean isAdd(HttpServletRequest request) {
        return false;
    }

    @Override
    public boolean add(HttpServletRequest request, HttpServletResponse response) {
        return false;
    }

    @Override
    public void initModify(HttpServletRequest request, HttpServletResponse response) {

    }

    @Override
    public void modify(HttpServletRequest request, HttpServletResponse response) {

    }

    @Override
    public String getCourses(HttpServletRequest request, HttpServletResponse response) {
        List<Course> courses = courseMapper.getCourses();
        return JSON.toJSONString(courses);
    }

    @Override
    public void delete(HttpServletRequest request, HttpServletResponse response) {

    }
}
